from apis.user_api import UserApi
import allure


class UserCase(UserApi):
    @allure.step("step:case_wallet")
    def case_wallet(self, data):
        """业务case：用户钱包余额"""
        wallet_response = self.wallet_api(data)
        res = wallet_response.json()
        return res

    @allure.step("step:case_detail")
    def case_detail(self, data):
        """业务case：用户详细信息"""
        detail_response = self.detail_api(data)
        res = detail_response.json()
        return res

    @allure.step("step:case_bind_bank_card")
    def case_bind_bank_card(self, data):
        """业务case：绑定银行卡"""
        bind_bank_card_response = self.bind_bank_card_api(**data["json"])
        res = bind_bank_card_response.json()
        return res

    @allure.step("step:case_bank_card_list")
    def case_bank_card_list(self, data):
        """业务case：用户绑定的银行卡列表"""
        bank_card_list_response = self.bank_card_list_api(data)
        res = bank_card_list_response.json()
        return res

    @allure.step("step:case_change_bank_card")
    def case_change_bank_card(self, data):
        """业务case：用户绑定的银行卡列表"""
        change_bank_card_response = self.change_bank_card_api(**data["json"])
        res = change_bank_card_response.json()
        return res

    @allure.step("step:case_balance_bill_list")
    def case_balance_bill_list(self, data):
        """业务case：用户余额收益明细"""
        balance_bill_list_response = self.balance_bill_list_api(**data["json"])
        res = balance_bill_list_response.json()
        return res

    @allure.step("step:case_nectar_bill_list")
    def case_nectar_bill_list(self, data):
        """业务case：用户花蜜收益明细"""
        nectar_bill_list_response = self.nectar_bill_list_api(**data["json"])
        res = nectar_bill_list_response.json()
        return res

    @allure.step("step:case_pollen_bill_list")
    def case_pollen_bill_list(self, data):
        """业务case：用户花粉收益明细"""
        pollen_bill_list_response = self.pollen_bill_list_api(**data["json"])
        res = pollen_bill_list_response.json()
        return res

    @allure.step("step:case_apply_withdraw")
    def case_apply_withdraw(self, data):
        """业务case：用户申请提现"""
        apply_withdraw_response = self.apply_withdraw_api(**data["json"])
        res = apply_withdraw_response.json()
        return res

    @allure.step("step:case_withdraw_list")
    def case_withdraw_list(self, data):
        """业务case：用户提现记录"""
        withdraw_list_response = self.withdraw_list_api(data)
        res = withdraw_list_response.json()
        return res

    @allure.step("step:case_income_tax")
    def case_income_tax(self):
        """业务case：查询提现个税百分比"""
        income_tax_response = self.income_tax_api()
        res = income_tax_response.json()
        return res